{strip}

{literal}
<script>

$(document).ready(function() { 
	var options = { 
        beforeSubmit:  showRequest,  // pre-submit callback 
        success:       showResponse  // post-submit callback 
    }; 
 
    // bind to the form's submit event 
    $('#page_add_form').submit(function() { 
    	for(var name in CKEDITOR.instances)
    		CKEDITOR.instances[name].updateElement();
        
    	$(this).ajaxSubmit(options); 
 
        // !!! Important !!! 
        // always return false to prevent standard browser submit and page navigation 
        //checkForm();
        return false;
    }); 
});

// pre-submit callback 
function showRequest(formData, jqForm, options) { 
    var queryString = $.param(formData); 
    //return checkForm(); 
} 
 
// post-submit callback 
function showResponse(responseText, statusText)  { 
	scroll(0,0);
	//showPopup2(responseText, 'New static page', false);
	window.location.reload();
}
</script>
{/literal}

<div id="backoffice" >
	<div id="pagesAddForm">
	<form id="page_add_form" method="POST" action="/pages/save" onsubmit="">
		<div>
			<h2>PAGE TITLE</h2>
			<input type="text" value="" name="addForm[title]" >
		</div>
		<div>
			<h2>PAGE TEASER</h2>
			<textarea name="addForm[teaser]" rows="3"></textarea>
		</div>
		<div>
			<h2>PAGE CATEGORY</h2>
			<select name="addForm[pagesCategoriesId]" id="f4">
				{foreach $categories as $c}
					<option value="{$c->getId()}">{if $c->getCategory() == ''}{$c->getOriginCategory()->getCategory()}{else}{$c->getCategory()}{/if}</option>
				{/foreach}
			</select>
		</div>
		<div>
			<h2>PAGE STATUS</h2>
			<select name="addForm[statusesId]" id="f4">
				{foreach from=$statuses item=st}
					<option value="{$st->getId()}">{$st->getCatalogue()->getCatalogue()} -- {$st->getStatus()}</option>
				{/foreach}
			</select>
		</div>
		<div>
			<h2>META TITLE</h2>
			<input type="text" value="" name="addForm[metaTitle]" >
		</div>
		<div>
			<h2>META DESCRIPTION</h2>
			<textarea name="addForm[metaDescription]" rows="3"></textarea>
		</div>
		<div>
			<h2>META TAGS</h2>
			<textarea name="addForm[metaTags]" rows="3"></textarea>
		</div>
		<div>
			<h2>STATIC URL (ex. CART)</h2>
			<input type="text" value="" name="addForm[staticUrl]" >
		</div>
		<div>
			<h2>TOP LINE CONTENT</h2>
			<div>{$editor2}</div>
		</div>
		<div>
			<h2>PAGE CONTENT</h2>
			<div>{$editor}</div>
		</div>
		
		<div>
			<input type="hidden" name="addForm[appsId]" value="{$appsId}" />
			<input type="hidden" name="addForm[pagesId]" value="0" />
		</div>
		<div class="v_spacer"> </div>
		<div>
			<div class="left">
				<input type="button" value="Resign" class="submit" onclick="closePopup();"/>
			</div>
			<div class="right">
				<input type="submit" value="Submit" class="submit"/>
			</div>
		</div>
	
		
	</form>
	</div>
</div>
{/strip}